% Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
{\ttfamily \raggedright {
\noindent
\mbox{}\textcolor{ForestGreen}{double}\ a\textcolor{BrickRed}{,}\ b\textcolor{BrickRed}{;}\ \textit{\textcolor{Brown}{//\ limites}} \\
\mbox{}\textbf{\textcolor{Blue}{const}}\ \textcolor{ForestGreen}{int}\ N\ \textcolor{BrickRed}{=}\ \textcolor{Purple}{1000}\textcolor{BrickRed}{*}\textcolor{Purple}{1000}\textcolor{BrickRed}{;} \\
\mbox{}\textcolor{ForestGreen}{double}\ s\ \textcolor{BrickRed}{=}\ \textcolor{Purple}{0}\textcolor{BrickRed}{;} \\
\mbox{}\textbf{\textcolor{Blue}{for}}\ \textcolor{BrickRed}{(}\textcolor{ForestGreen}{int}\ i\textcolor{BrickRed}{=}\textcolor{Purple}{0}\textcolor{BrickRed}{;}\ i\textcolor{BrickRed}{$<$=}N\textcolor{BrickRed}{;}\ \textcolor{BrickRed}{++}i\textcolor{BrickRed}{)}\ \textcolor{Red}{\{} \\
\mbox{}\ \ \ \ \ \ \ \ \textcolor{ForestGreen}{double}\ x\ \textcolor{BrickRed}{=}\ a\ \textcolor{BrickRed}{+}\ \textcolor{BrickRed}{(}b\ \textcolor{BrickRed}{-}\ a\textcolor{BrickRed}{)}\ \textcolor{BrickRed}{*}\ i\ \textcolor{BrickRed}{/}\ N\textcolor{BrickRed}{;} \\
\mbox{}\ \ \ \ \ \ \ \ s\ \textcolor{BrickRed}{+=}\ \textbf{\textcolor{Black}{f}}\textcolor{BrickRed}{(}x\textcolor{BrickRed}{)}\ \textcolor{BrickRed}{*}\ \textcolor{BrickRed}{(}i\textcolor{BrickRed}{==}\textcolor{Purple}{0}\ \textcolor{BrickRed}{$|$$|$}\ i\textcolor{BrickRed}{==}N\ \textcolor{BrickRed}{?}\ \textcolor{Purple}{1}\ \textcolor{BrickRed}{:}\ \textcolor{BrickRed}{(}i\textcolor{BrickRed}{\&}\textcolor{Purple}{1}\textcolor{BrickRed}{)==}\textcolor{Purple}{0}\ \textcolor{BrickRed}{?}\ \textcolor{Purple}{2}\ \textcolor{BrickRed}{:}\ \textcolor{Purple}{4}\textcolor{BrickRed}{);} \\
\mbox{}\textcolor{Red}{\}} \\
\mbox{}\textcolor{ForestGreen}{double}\ delta\ \textcolor{BrickRed}{=}\ \textcolor{BrickRed}{(}b\ \textcolor{BrickRed}{-}\ a\textcolor{BrickRed}{)}\ \textcolor{BrickRed}{/}\ N\textcolor{BrickRed}{;} \\
\mbox{}s\ \textcolor{BrickRed}{*=}\ delta\ \textcolor{BrickRed}{/}\ \textcolor{Purple}{3.0}\textcolor{BrickRed}{;}
}
